#include "sdObject.h"
#include <iostream>

void sdObject::addCircleShape(cpFloat inner, cpFloat outer, cpVect offset, int ctype) {
    cpBodySetMoment(body_, body_->i + cpMomentForCircle(body_->m, inner, outer, offset));
    
	cpShape* shape = cpCircleShapeNew(body_, outer, offset);
	shape->e = 0.6;

    shapeList_.push_back(shape);
    shapeList_.back()->collision_type = ctype;
}

void sdObject::addPolyShape(int numVerts, cpVect* verts, cpVect offset, int ctype) {
    cpBodySetMoment(body_, body_->i + cpMomentForPoly(body_->m, numVerts, verts, offset));
    
	cpShape* shape = cpPolyShapeNew(body_, numVerts, verts, offset);
	shape->e = 0.6;

    shapeList_.push_back(shape);
    shapeList_.back()->collision_type = ctype;
}

void sdObject::setMass(cpFloat mass) {
    cpBodySetMass(body_, mass);
}

